Back to course home
0% completed
Vote For New Content
Appendix
Contact Us
Maximum Sum Increasing Subsequence
Problem Statement
Given a number sequence, find the increasing subsequence with the highest sum. Write a method that returns the highest sum.
Example 1:
Input: {4,1,2,6,10,1,12}
Output: 32
Explanation: The increaseing sequence is {4,6,10,12}.
Please note the difference, as the LIS is {1,2,6,10,12} which has a sum of '31'.
Example 2:
Input: {-4,10,3,7,15}
Output: 25
Explanation: The increaseing sequences are {10, 15} and {3,7,15}.
Constraints:
1 <= nums.length <= 2500- -104 <= nums[i] <= 104
Try it yourself
Try solving this question here:
Java
Saved to Cloud
. . . .
Solution: Longest Increasing Subsequence
Solution: Maximum Sum Increasing Subsequence
Mark as Completed
On this page
Problem Statement
Try it yourself